package org.javacore.collection.queue;

import java.util.LinkedList;
import java.util.Queue;

/**
 * Created by Administrator on 2017/2/15.
 */
public class QueueTest {
    public static void main(String[] args) {
        Queue<String> q = new LinkedList<String>();
        q.offer("String");
        q.offer(new String("String"));
        q.offer("Integer");
        q.offer("Double");
        //有序，先进先出
        System.out.println(q);
        System.out.println(q.size());
        String str;
        while ((str=q.poll())!=null){
            System.out.println(str);
        }
        System.out.println(q.size());
    }
}
